package com.atguigu.jxc.dao;

import com.atguigu.jxc.entity.Goods;
import com.atguigu.jxc.entity.GoodsData;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @description 商品信息
 */
public interface GoodsDao {


    String getMaxCode();

    int getGoodsCount();

    List<Goods> getGoodsList(@Param("offSet") int offSet, @Param("rows") Integer rows, @Param("codeOrName") String codeOrName, @Param("goodsTypeId") Integer goodsTypeId);

    Goods findGoodsByName(@Param("goodsName") String goodsName);

    void insertGoods(@Param("goods") GoodsData goodsData);

    void updateGoods(@Param("goods") GoodsData goodsData, @Param("goodsId") Integer goodsId);

    void delete(@Param("goodsId") Integer goodsId);

    Integer selectState(@Param("goodsId") Integer goodsId);

    Integer getNoInventoryQuantityCount();

    List<Goods> getNoInventoryQuantity(@Param("offSet") int offSet, @Param("rows") Integer rows, @Param("nameOrCode") String nameOrCode);

    void updateInventory(@Param("goodsId") Integer goodsId, @Param("inventoryQuantity") Integer inventoryQuantity);

    void updatePurchasingAndLastPurchasing(@Param("goodsId") Integer goodsId, @Param("purchasingPrice") double purchasingPrice);

    List<Goods> listAlarm();
}
